package com.goktech.dao.impl;

import java.util.List;

import org.mybatis.spring.support.SqlSessionDaoSupport;
import org.springframework.stereotype.Repository;
import com.goktech.dao.StudentDao;
import com.goktech.domain.Student;

@Repository
public class StudentDaoImpl extends SqlSessionDaoSupport implements StudentDao {

	@Override
	public int insert(Student student) {
		return this.getSqlSession().insert(this.getClass().getName() + ".add", student);
	}

	@Override
	public List<Student> selectAll() {
		List<Student> list=this.getSqlSession().selectList("findList");
		return list;
	}

	@Override
	public int delete(Integer id) {
		// TODO Auto-generated method stub
		return this.getSqlSession().insert(this.getClass().getName() + ".delete", id);
	}
}
